package so.sia.util;

import java.io.UnsupportedEncodingException;

public class Encoder {
	public static String isoToEuc(String tmp){
		String euc = "";
		try{
			euc = new String(tmp.getBytes("ISO-8859-1"),"EUC-KR");
		} catch (UnsupportedEncodingException e){
			e.printStackTrace();
		}
		return euc;
	}
	
	public static String eucToISO(String tmp){
		String euc = "";
		try{
			euc = new String(tmp.getBytes("EUC-KR"),"ISO-8859-1");
		} catch (UnsupportedEncodingException e){
			e.printStackTrace();
		}
		return euc;
	}
	
	public static String utfToEuc(String tmp){
		String euc = "";
		try{
			euc = new String(tmp.getBytes("UTF-8"),"EUC-KR");
		} catch (UnsupportedEncodingException e){
			e.printStackTrace();
		}
		return euc;
	}
	
	public static String eucToUtf(String tmp){
		String euc = "";
		try{
			euc = new String(tmp.getBytes("EUC-KR"),"UTF-8");
		} catch (UnsupportedEncodingException e){
			e.printStackTrace();
		}
		return euc;
	}

}
